#! /usr/bin/env python

import argparse
import os

def compile():
  pass

def run():
  pass

def send():
  pass

def check():
  asd = os.system("echo $ASD")
  print(asd)
  pass

if __name__ == "__main__":
  main_parser = argparse.ArgumentParser(description="Utility to compile, run, send jobs to the central cluster Brutus and perform library checks for the program.")
  main_parser.add_argument('--host',choices=["local", "brutus"], default="local", help="host machine")
  
  sub_parser = main_parser.add_subparsers(dest="action")
  
  parser1 = sub_parser.add_parser("check", description="Perform library, compatibility and other sanity checks on the system")
  parser2 = sub_parser.add_parser("compile-libraries", description="Compile the libraries needed by the program")
  parser2 = sub_parser.add_parser("compile", description="Compile the program")
  parser2 = sub_parser.add_parser("run", description="Run the job locally")
  parser2 = sub_parser.add_parser("send", description="Send job to a remote custer (currently only brutus, via bsub")
  parser2 = sub_parser.add_parser("postprocess", description="Postprocess results from run (plot, mean and variance computations, etc.)")
  
  args = main_parser.parse_args()
  print(args)
  
  check()
